package com.tudouji.project.bill.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.flow.service.pojo.flow.FlowTempNode;
import com.tudouji.framework.aspectj.lang.annotation.Excel;
import com.tudouji.project.customer.domain.Customer;
import com.tudouji.project.flow.domain.BasePojo;
import com.tudouji.project.pay.domain.Backinfo;
import com.tudouji.project.wlinfo.domain.Wlinfo;
import lombok.Data;

import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 销售订单对象 sellform
 *
 * @author wf
 * @date 2021-01-13
 */
@Data
public class SellformOld extends BasePojo
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private Long id;
    private String guid;

    /** 流程模板ID */
    @Excel(name = "流程模板ID")
    private String flowtempguid;

    /** 订单编码 */
    @Excel(name = "订单编码")
    private String sellcode;

    /** 申请人姓名 */
    @Excel(name = "申请人姓名")
    private String applyname;

    /** 订单部门ID */
    @Excel(name = "订单部门ID")
    private String depguid;

    private Long deptId;

    /** 订单部门名称 */
    @Excel(name = "订单部门名称")
    private String depname;

    /** 销售主体公司名称 */
    @Excel(name = "销售主体公司名称")
    private String orgName;

    /** 销售主体公司ID */
    @Excel(name = "销售主体公司ID")
    private String sorgguid;

    private Long orgId;

    /** 客户ID */
    @Excel(name = "客户ID")
    private String customerguid;

    /** 客户名称 */
    @Excel(name = "客户名称")
    private String customername;

    /** 订单重量 */
    @Excel(name = "订单重量")
    private BigDecimal orderweight;

    /** 库房 */
    @Excel(name = "库房")
    private String storermguid;

    private Long strmId;

    /** 出库净重 */
    @Excel(name = "出库净重")
    private BigDecimal loadweight;

    /** 到货净重 */
    @Excel(name = "到货净重")
    private BigDecimal unnloadweight;

    /** 包装重量 */
    @Excel(name = "包装重量")
    private BigDecimal packweight;

    /** 扣前金额 */
    @Excel(name = "扣前金额")
    private BigDecimal amount;

    /** 结算金额 */
    @Excel(name = "结算金额")
    private BigDecimal finalamount;

    /** 状态 */
    @Excel(name = "状态")
    private Integer status;

    /** 备注 */
    @Excel(name = "备注")
    private String remarks;

    /** 创建人 */
    @Excel(name = "创建人")
    private String operatorid;

    /** 出库类型2-产成品库；1原材料库 */
    @Excel(name = "出库类型2-产成品库；1原材料库")
    private Integer quitsrtype;

    /** 结算方式 */
    @Excel(name = "结算方式")
    private Integer settletype;

    /** 结算账期 */
    @Excel(name = "结算账期")
    private Integer settlebilling;

    /** 收到发票后结算天数 */
    @Excel(name = "收到发票后结算天数")
    private Integer settledays;

    /** 出库件数 */
    @Excel(name = "出库件数")
    private Integer loadcount;

    /** 到货件数 */
    @Excel(name = "到货件数")
    private Integer unloadcount;

    /** 促销让利方式1-优惠让利2-扣杂 */
    @Excel(name = "促销让利方式1-优惠让利2-扣杂")
    private Integer concessiontype;

    /** 最大扣杂率 */
    @Excel(name = "最大扣杂率")
    private BigDecimal maxdeduct;

    /** 合同id */
    @Excel(name = "合同id")
    private String contractid;

    /** 合同编号 */
    @Excel(name = "合同编号")
    private String contractcode;

    /** 合同名称 */
    @Excel(name = "合同名称")
    private String contractname;

    /** 付款方式 1-全款预付，2-上车付款，3-到货付款 */
    @Excel(name = "付款方式 1-全款预付，2-上车付款，3-到货付款")
    private Integer paytype;

    /** 结算币种 1-人民币 2-美元 */
    @Excel(name = "结算币种 1-人民币 2-美元")
    private Integer currency;

    /** 订单标识 1-普通订单 ,2-大订单,3-子订单 */
    @Excel(name = "订单标识 1-普通订单 ,2-大订单,3-子订单")
    private Integer flag;

    /** 订单编号子订单中记录的大订单编号 */
    @Excel(name = "订单编号子订单中记录的大订单编号")
    private String parentcode;

    /** 订单id子订单中记录的大订单id */
    @Excel(name = "订单id子订单中记录的大订单id")
    private String parentguid;

    /** 过磅重量 */
    @Excel(name = "过磅重量")
    private BigDecimal lbweight;

    /** 质检结果：1合格 2不合格 */
    @Excel(name = "质检结果：1合格 2不合格")
    private Integer qaresult;

    /** 结算重量 */
    @Excel(name = "结算重量")
    private BigDecimal finalweight;

    /** 结算数量 */
    @Excel(name = "结算数量")
    private Integer finalcount;

    /** 回款日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "回款日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date backmoneytime;

    /** 物流配送方式 1-客户自提2-送货上门 */
    @Excel(name = "物流配送方式 1-客户自提2-送货上门")
    private Integer deliverytype;

    /** 订单件数 */
    @Excel(name = "订单件数")
    private Integer orderpack;

    /** 已回款金额 */
    @Excel(name = "已回款金额")
    private BigDecimal backmoney;

    /** 赠送数量 */
    @Excel(name = "赠送数量")
    private Integer handselcount;

    /** 赠送重量 */
    @Excel(name = "赠送重量")
    private BigDecimal handselweight;

    /** 交接人guid */
    @Excel(name = "交接人guid")
    private String transferguid;

    /** 结算日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "结算日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date settletime;

    /** 1-退款 2-换货 3-补货 */
    @Excel(name = "1-退款 2-换货 3-补货")
    private Integer withdrawtype;

    /** 业务运输方式：1-汽运、2-海运、3-空运 */
    @Excel(name = "业务运输方式：1-汽运、2-海运、3-空运")
    private Integer transtype;

    /** 订单类型：1-国内、2-海外 */
    @Excel(name = "订单类型：1-国内、2-海外")
    private Integer type;

    /** 分拆标识：1-普通订单，2-分拆主订单，3-分拆后同库房子订单 4-分拆后跨库房子订单 */
    @Excel(name = "分拆标识：1-普通订单，2-分拆主订单，3-分拆后同库房子订单 4-分拆后跨库房子订单")
    private Integer partitionflag;

    /** 扣款金额 */
    @Excel(name = "扣款金额")
    private BigDecimal deductamount;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createtime;

    private Long createBy;

    private int isdiscount;
    private String remark;
    private BigDecimal shWeight;
    private List<Sellitem> sellitemList;
    private String condition;
    private String minstatus;
    private String maxstatus;
    private String[] ids;
    private Integer[] stats;
    private Integer[] nostats;// 状态组
    private Integer[] paytypes;// 支付方式
    private Integer ltstatus;
    private String transType;
    private String senddate;
    private String arrivedate;
    private String name;
    private String district;
    private String statusname;
    private String arricity;
    private String arriaddres;
    private String carcode;
    private String settletypename;
    private String unit;
    private BigDecimal sifinalamount;
    private String outtime;
    private String withdrawtypename;
    private BigDecimal siloadweihgt;
    private BigDecimal siunloadweight;
    private String customercurrencyname;
    private String customerprebalance;
    private String paytypename;
    private String deliverytypename;
    private String quitSRTypeName;
    private String flagname;
    private String transTypename;
    private String storerOrgguid;
    private String sorgname;
    private List<Sellitem> items;
    private Whoutform whoutform;
    private Customer customer;
    private String storeroomname;
    private String productname;
    private String spname;
    private Backinfo backinfo;

    private String  arriProvince;
    private String  arriCity;
    private String  arriDistrict;
    private String  arriAddress;
    private String  arriContact;
    private String  arriContactNo;

    private String  deliProvince;
    private String  deliCity;
    private String  deliDistrict;
    private String  deliAddress;
    private String  deliContact;
    private String  deliContactNo;

    private String  productTypes;
    private String  search;
    private String  keyword;
    // 检索条件
    private String[] depids;
    private String[] roomids;
    private List<FlowTempNode> nodes;

    private Wlinfo wlentity;

    private List<Sellspitem> spitems;

    private List<Sellitem> pitems;

    private Integer moneybackStatus;

    @Override
    public String getValueByParam(String param) {
        try {
            Field field = this.getClass().getDeclaredField(param);
            // 设置对象的访问权限，保证对private的属性的访问
            field.setAccessible(true);
            return field.get(this) == null ? "" : field.get(this).toString();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}
